function level = liquid_level(liquid_volume, bottle_shape, mode_parameters)
switch mode_parameters.mode_name
    case 'monte_carlo'
        volume_function = @(liquid_level) monte_carlo_estimation(bottle_shape, liquid_level, mode_parameters, 'volume') - liquid_volume;
    case 'mesh'
        rot_matr = rotation_matrix(mode_parameters.rotation_angle);
        mode_parameters.rotated_vertices = (rot_matr * mode_parameters.vertices')'; 
        volume_function = @(liquid_level) mesh_estimation(liquid_level, mode_parameters, 'volume') - liquid_volume;
    otherwise
        error('Invalid mode!');
end
start_level = 10;
level = fzero(volume_function, start_level);